/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sive.vista.modelo;

import java.util.Date;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import java.io.Serializable;
import java.util.TimeZone;
import java.util.Calendar;


@ManagedBean(name= VehiculoCosulta.BEAN_NAME)
@ViewScoped



public class VehiculoCosulta  implements Serializable {

    /**
     * Creates a new instance of VehiculoCosulta
     */
    

            
     public Date Desde = getDefaultDate();
    public Date Hasta=  getDefaultDate();
    
    public Date getDesde() {
        return Desde;
    }

    public Date getHasta() {
        return Hasta;
    }
     

    public void setDesde(Date Desde) {
        this.Desde = Desde;
    }

    public void setHasta(Date Hasta) {
        this.Hasta = Hasta;
    }
     
    public VehiculoCosulta() {
    }
     public void initMetaData() {
     }
    public VehiculoCosulta(Date Desde, Date Hasta) {
        this.Desde = Desde;
        this.Hasta = Hasta;
    }
    
    
    
     public static final String BEAN_NAME = "vehiculoCosulta";
    
       public String getPattern() { return DEFAULT_PATTERN; }
       
       public static final String DEFAULT_PATTERN = "MM/dd/yyyy"; 
    //private Date date = VehiculoCosulta.getDefaultDate();
    private boolean renderAsPopup = true;
    private boolean renderMonthAsDropdown = false;
    private boolean renderYearAsDropdown = false;

    
   // public Date getDate() { return date; }
   
    public boolean getRenderAsPopup() { return renderAsPopup; }
    public boolean getRenderMonthAsDropdown() { return renderMonthAsDropdown; }
    public boolean getRenderYearAsDropdown() { return renderYearAsDropdown; }
    
   // public void setDate(Date date) { this.date = date; }
    public void setRenderAsPopup(boolean renderAsPopup) { this.renderAsPopup = renderAsPopup; }
    public void setRenderMonthAsDropdown(boolean renderMonthAsDropdown) { this.renderMonthAsDropdown = renderMonthAsDropdown; }
    public void setRenderYearAsDropdown(boolean renderYearAsDropdown) { this.renderYearAsDropdown = renderYearAsDropdown; }

     public static Date getDefaultDate() {
        return getDefaultDate(TimeZone.getDefault());
    }
    
    /**
     * Convenience method to get a default current date in the specified timezone
     */
    public static Date getDefaultDate(TimeZone timezone) {
        return Calendar.getInstance(timezone).getTime();
    }
}
